﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace huaguwang.hgmanage.CreateWeb
{
    public partial class CreateBook : System.Web.UI.Page
    {
        public string URL = "";
        protected void Page_Load(object sender, EventArgs e)
        {
            URL = ViewState["url"].Exp_Trim();
            if(0 >= URL.Length)
            {
                URL = "/index.html";
            }
            this.WebUserToolBar1.MainInit(
                    UserConst.Exp_GetUser,
                    UserConst.Exp_GetButtonList,
                    null,
                    UserConst.Exp_ToolBarErr,
                    null
                );
        }
        /// <summary>
        /// 首页
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void WebUserToolBar1_Button0(object sender, EventArgs e)
        {
            AdminPublic.Try(() =>
            {

                this.Literal1.Text = "共需生成两项：<br/>";
                var ss = Request.Url.AbsolutePath;

                this.Literal1.Text += this.Exp_PageSetText("/virtualWeb/book/book_image.aspx", "/book/book_image.html", "1 书籍首页－图片列表");
                this.Literal1.Text += this.Exp_PageSetText("/virtualWeb/book/book_list.aspx", "/book/book_list.html", "2 书籍首页－普通列表");

            });
        }
        
        /// <summary>
        /// 登录注册
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void WebUserToolBar1_Button1(object sender, EventArgs e)
        {
            AdminPublic.Try(() =>
            {
                //try
                //{
                //    this.Literal1.Text = "共需生成三项：<br/>";
                //    var ss = Request.Url.AbsolutePath;

                //    SetText("/virtualWeb/user/login.aspx", "/user/login.html", "1 登录页面");
                //    SetText("/virtualWeb/user/new_register.aspx", "/user/new_register.html", "2 注册第一页");
                //    SetText("/virtualWeb/user/new_register_callback.aspx", "/user/new_register_callback.html", "3 注册第二页");

                //    //Page.Exp_SaveURL("/virtualWeb/user/login.aspx", Server.MapPath("/user/login.html"));
                //    //this.Literal1.Text += "1 登录页生成完毕<br/>";
                //    //Page.Exp_SaveURL("/virtualWeb/user/new_register.aspx", Server.MapPath("/user/new_register.html"));
                //    //this.Literal1.Text += "2 注册１生成完毕<br/>";
                //    //Page.Exp_SaveURL("/virtualWeb/user/new_register_callback.aspx", Server.MapPath("/user/new_register_callback.html"));
                //    //this.Literal1.Text += "3 注册２生成完毕<br/>";
                //    //ViewState["url"] = "/user/register.html";
                //    //this.Exp_PageAlter("操作完毕");
                //}
                //catch(Exception ex)
                //{
                //    //this.Exp_PageAlter("操作失败:" + ex.Message.Replace("\n", ""));
                //    //this.Literal1.Text = ex.Message.Replace("\n", "") + "：<br/>";
                //}

            });
        }

        protected void WebUserToolBar1_Button2(object sender, EventArgs e)
        {

        }

    }
}
